package com.test7;

import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class MyJunit {

	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
		Class c=Class.forName("com.test7.UsersBizImplTest");
		//激活一个对象
		Object o=c.newInstance();
		//取出所有的方法,判断如果加了Test注解，则调用，否则不调用
		Method[] ms=c.getMethods();
		for(Method m:ms){
			if(m.isAnnotationPresent(Test.class)){
				m.invoke(o, null);
			}
		}

	}
}
